package br.com.testes;

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

public class GEvents implements KeyListener {
	
	GWindow window = null;
	private boolean vKeys[] = new boolean[256];
	
	public GEvents(GWindow pWindow)	{
		window = pWindow;
		window.addKeyListener(this);
	}
	
	public void keyPressed(KeyEvent e) {
		vKeys[e.getKeyCode()] = true;
	}

	public void keyReleased(KeyEvent e) {
		vKeys[e.getKeyCode()] = false;
	}

	public void keyTyped(KeyEvent e) {}
	
	public boolean isKeyPressed(int key) {
		return vKeys[key];
	}
}
